package week3;

import java.math.BigInteger;

public class Ex25 {
    public static void main(String[] args) {
        BigInteger[] fib = {BigInteger.ONE, BigInteger.ONE, BigInteger.ZERO};
        BigInteger m = BigInteger.ONE;
        for (int i = 1; i < 1000; ++i){
            m = m.multiply(BigInteger.valueOf(10));
        }
        int i;
        for (i =2; fib[(i-1)%3].compareTo(m) < 0; i++){
            fib[i%3] = fib[(i-1)%3].add(fib[(i-2)%3]);
        }
        System.out.println(i-1 +1);
    }
}
